package com.aqie.medium.unionFind;

import com.aqie.libs.StdOut;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;

/**
 * @Function: 399. 除法求值  todo
 * @Author: aqie
 * @Date: 2019/8/24 9:37
 */
public class CalcEquation {
    public static double[] calcEquation(List<List<String>> equations, double[] values, List<List<String>> queries) {
        return null;
    }

    public static void main(String[] args) {
        List<List<String>> equations = new ArrayList<>();
        List<String> equation1 = new ArrayList<>();
        equation1.add("a");
        equation1.add("b");
        List<String> equation2 = new ArrayList<>();
        equation2.add("b");
        equation2.add("c");
        equations.add(equation1);
        equations.add(equation2);

        double[] values = {2.0, 3.0};

        List<List<String>> queries = new ArrayList<>(){{
           add(List.of("a","c"));
           add(List.of("b","a"));
           add(List.of("a","e"));
           add(List.of("a","a"));
           add(List.of("x","x"));
        }};
        double[] doubles = calcEquation(equations, values, queries);
        StdOut.print(doubles);
    }

    public static void initList(){
        // 1. Arrays 工具类
        List<String> jdks = asList("JDK6", "JDK8", "JDK10");
        StdOut.print(jdks);

        // 2. Collections 工具类
        List<String> apples = Collections.nCopies(3, "apple");      // 不可变
        System.out.println(apples);

        List<String> dogs = new ArrayList<>(Collections.nCopies(3, "dog"));
        dogs.add("dog");
        System.out.println(dogs);

        // 3.JDK8 Streams
        List<String> colors = Stream.of("blue", "red", "yellow").collect(toList());
        System.out.println(colors);

        // 4.JDK9 List.of
        List<String> cups = List.of("A", "B", "C");
        System.out.println(cups);
    }
}
